
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>tree</title>
  <link rel="stylesheet" href="${pageContext.request.contextPath}/js/z-tree/css/zTreeStyle/zTreeStyle.css" type="text/css">
  <script type="text/javascript" src="${pageContext.request.contextPath}/js/z-tree/jquery-1.4.4.min.js"></script>
  <script type="text/javascript" src="${pageContext.request.contextPath}/js/z-tree/jquery.ztree.core-3.5.js"></script>
  <script type="text/javascript">
    var setting = {
      async: {
        enable: true,
        autoParam:["id","name"],
        type:"post",
        url:"${pageContext.request.contextPath}/menu/menu_queryAll",
        dataFilter: null
      },
      callback: {
        onClick: zTreeOnClick
      }
    };

    $(document).ready(function(){
      $.fn.zTree.init($("#menu_tree"), setting);
    });

    function zTreeOnClick(event, treeId, treeNode){
      if(treeNode.parameter) {
        tree_click(treeNode.name, treeNode.parameter);
      }
    }

    function tree_click(name,url){
      window.parent.window.addTab({title:name,content:'<iframe src="${pageContext.request.contextPath}'+ url +'" frameborder="0" style="border:0;width:100%;height:98%;"></iframe>',closable:true});
    }
  </script>
  <style>
    html,body{border:0;margin:0 0;padding:0 0;}
  </style>
</head>
<body>
    <div>
      <ul id="menu_tree" class="ztree"></ul>
    </div>
</body>
</html>
